package com.wuxianedu.loadimage;

import android.content.Context;
import android.graphics.Bitmap;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

import java.security.KeyStore;

/**
 * Created by TED on 2016/9/30.
 */
public class GridAdapter extends BaseAdapter {
    Context mContext;
    String[] urls;

    public GridAdapter(Context mContext, String[] urls) {
        this.mContext = mContext;
        this.urls = urls;
    }

    @Override
    public int getCount() {
        return urls.length;
    }

    @Override
    public Object getItem(int position) {
        return urls[position];
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(final int position, View convertView, ViewGroup parent) {
        if (convertView == null) {
            convertView = View.inflate(mContext, R.layout.item_grid, null);
        }

        ImageView image = (ImageView) convertView.findViewById(R.id.image_view);

//        ImageLoader.loadImage(image, urls[position], true);

        return convertView;
    }
}
